from typing import List


class Solution:
    def buildArray(self, target: List[int], n: int) -> List[str]:
        # 用数组 模拟 栈的 操作
        j = 1
        ans = []
        i = 0
        while i < len(target):
            if target[i] == j:
                ans.append("Push")
                j += 1
                i += 1
            else:
                ans.append("Push")
                ans.append("Pop")
                j += 1

        return ans